package GUI;

import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import ModelLayer.*;
/**
 * The test class tester.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class tester
{
    private ModelLayer.EmployeeContainer employee1;
    private ModelLayer.Employee employee2;

    //     private ModelLayer.Session s;

    private ModelLayer.ManagerContainer m1;
    private ModelLayer.Manager m2;

    private ModelLayer.LeaseContainer l1;
    private ModelLayer.Lease l2;

    private ModelLayer.ProductContainer p1;
    private ModelLayer.Product p2,p3;

    private ModelLayer.SaleContainer s1;
    private ModelLayer.Sale s2;

    private ModelLayer.CustomerContainer c1;
    private ModelLayer.Customer c2;

    private ModelLayer.DeliveryContainer d1;
    private ModelLayer.Delivery d2;
    /**
     * Default constructor for test class tester
     */
    public tester()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
        employee1 = EmployeeContainer.getInstance();
        employee2 = new ModelLayer.Employee(1, "gosho", "asd", "123", "dasd", "asd");
        employee1.addEmployee(employee2);
        m1 = ManagerContainer.getInstance();
        m2 = new ModelLayer.Manager(2, "Pesho", "asd", "123",  "asd", "2");

        //         s =  Session.getInstance();
        m1.addManager(m2);


        p1 = ProductContainer.getInstance();
        p2 = new Product(1, "asd", 123, 123, 123, 123, 1203, 1,  100, 1, 1);
        p1.addProduct(p2);

        p3 = new Product(2, "asd", 123, 123, 123, 123, 1203, 1,  100, 1, 1);
        p1.addProduct(p3);

        c1 = CustomerContainer.getInstance();
        c2 = new Customer(1, "asd", "asd", "asd", "asd");
        c1.addCustomer(c2);

        s1 = SaleContainer.getInstance();
        s2 = new Sale(1, 1, 1);
        s2.addProduct(1,10);
        s2.addProduct(2,20);
        s1.addSale(s2);

        d1 = DeliveryContainer.getInstance();
        d2 = new Delivery(1,1,1, "asd", "asd", 150);
        d2.addProduct(2,20);

        d2.addProduct(1,10);
        d1.addDelivery(d2);

        l1 = LeaseContainer.getInstance();
        l2 = new Lease(1, "123", "asd",123, "123", 1, 1);
        l2.addProduct(1,10);
        l2.addProduct(2,20);
        l1.addLease(l2);
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }
}
